package net.stogi.unicore.beyond.ui.client.taskeditor.taskoutline;

import net.stogi.unicore.beyond.api.model.InputDefinition;

import com.google.gwt.event.shared.GwtEvent;

public class EditInputDefinitionEvent extends GwtEvent<EditInputDefinitionHandler> {

	public static final GwtEvent.Type<EditInputDefinitionHandler> TYPE = new GwtEvent.Type<EditInputDefinitionHandler>();

	private InputDefinition inputDefinition;

	public EditInputDefinitionEvent(InputDefinition inputDefinition) {
		this.inputDefinition = inputDefinition;
	}

	@SuppressWarnings("unused")
	private EditInputDefinitionEvent() {}

	@Override
	public Type<EditInputDefinitionHandler> getAssociatedType() {
		return TYPE;
	}

	public InputDefinition getInputDefinition() {
		return inputDefinition;
	}

	public void setInputDefinition(InputDefinition inputDefinition) {
		this.inputDefinition = inputDefinition;
	}

	@Override
	protected void dispatch(EditInputDefinitionHandler handler) {
		handler.onEditInputDefinition(this);
	}
}
